package icu.shaoyayu.common.log.appender;


import icu.shaoyayu.common.log.LoggingEvent;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

/**
 * @author shaoyayu
 * @date 2022/2/10
 * @apiNote
 * 控制台输出控制台输出
 */
public class ConsoleAppender implements Appender {

    private OutputStream out = System.out;

    @Override
    public void append(LoggingEvent event) {
        try {
            out.write(event.toString().getBytes(StandardCharsets.UTF_8));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
